package cn.xhjava.crm.workbench.service.impl;

import cn.xhjava.crm.workbench.domain.TranRemark;
import cn.xhjava.crm.workbench.mapper.TranRemarkMapper;
import cn.xhjava.crm.workbench.service.TransactionRemarkRemarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Xiahu
 * @create 2023/7/27 0027
 */
@Service
public class TransactionRemarkRemarkServiceImpl implements TransactionRemarkRemarkService {

    @Autowired
    private TranRemarkMapper tranRemarkMapper;

    @Override
    public int add(TranRemark remark) throws Exception {
        return tranRemarkMapper.insert(remark);
    }

    @Override
    public int delete(String id) throws Exception {
        return tranRemarkMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(TranRemark remark) throws Exception {
        return tranRemarkMapper.updateByPrimaryKeySelective(remark);
    }

    @Override
    public List<TranRemark> selectDetailByTranId(String id) throws Exception {
        return tranRemarkMapper.selectDetailByTranId(id);
    }
}
